package com.donfelix.animationdemo.common;

import android.databinding.BindingAdapter;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.widget.ImageView;

import java.io.Serializable;

/**
 * Created by Don on 2017/3/22.
 * Desc
 */

public class Sample implements Serializable {
    private int color;
    private String name;

    public Sample(int color, String name) {
        this.color = color;
        this.name = name;
    }

    @BindingAdapter("colorTint")
    public static void setColorTint(ImageView view, int color) {
        DrawableCompat.setTint(view.getDrawable(), color);
    }

    public String getName() {
        return name;
    }

    public int getColor() {
        return color;
    }
}
